package com.xuyuan.json.jackson.polymorphic;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;


@JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,
        include = JsonTypeInfo.As.EXISTING_PROPERTY,
        property = "type",
        visible = true
)
@JsonSubTypes(
        value = {
                @JsonSubTypes.Type(value = JacksonProduct1.class, name = "product1"),
                @JsonSubTypes.Type(value = JacksonProduct2.class, name = "product2")
        }
)
@Data
public abstract class JacksonParent {
    private String year = "2024";
}
